<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script>
	function dong(obj){
		var x = parseInt(obj.style.top);
		if(x==400){
			obj.style.top = 380+"px";
		}else{
			obj.style.top = 400+"px";
		}
	}
	
	function on(){
		var  array = new Array();
		var imgs = document.getElementsByTagName("img");
		for(var i=0;i<imgs.length;i++){
			var x = parseInt(imgs[i].style.top);
			if(x==380){
				array.push(imgs[i].src);
			}
		}
		/**
		重点:通过url地址传递参数,地址?参数名称=参数值&参数名称2=参数值&参数名称3=参数值
			参数的接收:request.getParameter(参数名称),接收到的参数为String类型
		*/
		window.location.href="http://localhost:8080/day09/puke/chuli.jsp?chupai="+array+"";//通过js模拟超链接操作,完成页面跳转
	}
</script>
<body>
可以玩牌了
<%
	//接收处理过的结果
	String[] chupais = (String[])session.getAttribute("chupais");
%>
<%
	if(chupais != null){
		for(int i=0;i<chupais.length;i++){
			%>
			<img src="<%=chupais[i] %>" />
			<%
		}
	}
	
%>
<hr>
<%
	for(int i=1;i<=4;i++){
		for(int j=1;j<=13;j++){
			%>
			<img src="http://localhost:8080/day09/card/<%=j %>-<%=i %>.bmp" style="position:absolute;top:400px;left:<%=(13*(i-1)+j-1)*20%>px" onclick="dong(this)"/>
			<%
		}
	}
%>
<input type="button" onclick="on()" value="点我出牌">
</body>
</html>